<?php 
if ( $_GET[md5('actionRegistro')] != "" && !$_POST ){

		$objRecorSet = $objConn->Execute('DELETE FROM tbl_vaga WHERE md5(co_vaga) = \''.$_GET[md5('actionRegistro')].'\' 
											AND md5(co_cadastro) = \''. $_SESSION[md5('codigoUsuario')]."'") ;										
		echo	$strMensagem =  '<h1  style="color:#FF0000">Registro de Curso removido com sucesso. </h1>';
}



?>


<table width="98%" cellpadding="3" cellspacing="0" border="0">
            <tr>
              <td colspan="2" align="center"  class="tit_grid">Vagas Cadastradas</td>
  </tr>
            <?php 
		$objRegistro  =  $objConn->Execute("SELECT *,DATE_FORMAT(dt_cadastro,'%d/%m/%Y') as dt_cadastro
											FROM
											  tbl_vaga
											WHERE md5(co_cadastro) = '". $_SESSION[md5('codigoUsuario')]."'
											ORDER BY dt_cadastro DESC");
		
		if( $objError->semErros() && $objRegistro->_numOfRows > 0)
		{
		    
			while( !$objRegistro->EOF ) { 
					
			
?>
            <tr>
              <td width="173" align="left" valign="middle" bgcolor="#F8F8F8">
              <a href="detalhes_vaga.php?<?php echo md5('actionRegistro').'='.md5( $objRegistro->fields['co_vaga'] ); ?>"><img src="images/icones/detalhe_icon.png"  border="0" align="left" title="Detalhes desta vaga"/></a>
              <a href="candidatos_vaga.php?<?php echo md5('actionRegistro').'='.md5( $objRegistro->fields['co_vaga'] ); ?>"><img src="images/icones/candidato_icon.png" border="0" align="left" title="Candidatos para esta vaga"/></a>
              <a href="javascript:confirma('?<?php echo md5('actionRegistro').'='.md5( $objRegistro->fields['co_vaga'] ); ?>');"><img src="images/icones/excluir_icon.png" border="0" align="left" title="Excluri esta vaga"/></a>             
               </td>
              <td width="1033" align="left" valign="middle" bgcolor="#F8F8F8" ><div style="font-size:14px;color:#333333"> <strong><?php echo $objRegistro->fields['no_vaga']; ?></strong></div>
                <strong><br />
                Data de Cadastro</strong>: <?php echo $objRegistro->fields['dt_cadastro']; ?><br />
              </td>
  </tr>
            <tr>
              <td width="173" align="left" valign="middle" bgcolor="#ffffff"></td>
              <td width="1033" align="left" valign="middle" bgcolor="#ffffff"></td>
  </tr>
            <?php $objRegistro->MoveNext();
			}
		} else{
	?>
            <tr>
              <td width="173" align="left" valign="middle" bgcolor="#F8F8F8"></td>
              <td width="1033" align="left" valign="middle" bgcolor="#F8F8F8">Nenhuma vaga cadastrada.</td>
  </tr>
            <?php }?>
            </table>
<p><strong>Legenda:</strong></p>
<p><img src="images/icones/detalhe.png"  border="0" align="left" />&nbsp;<img src="images/icones/candidato.png" border="0" align="left" />&nbsp;<img src="images/icones/excluir.png" border="0" align="left" /></p>
<p>&nbsp; </p>
<script>
function confirma(url){
	if(confirm("Deseja realmente excluir esta vaga?")) {
		window.location = url;
		return true;
	}
}
  </script>
